<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <script src="js/jquery-1.11.0.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/getParameter.js"></script>
    <style>
        body {
            background: url(img/contextbc.jpg) no-repeat left top;
            background-size: 100%;
            background-attachment: fixed;
        }

        .navbar {
            height: auto;
        }

        .carousel img {
            width: 100%;
            height: auto;
        }


        .navbar-middle {
            float: right;
            font-size: 13px;
            color: white;
            vertical-align: middle;
            text-align: center;
            width: 200px;

        }

        .title {
            border-bottom: 1px grey solid;
            color: black;
            font-size: 20px;
            height: 150px;
        }

        .context {
            min-height: 400px;
            margin-top: 40px;
            color: black;
            font-size: 20px;
        }

        .img26 {
            width: 30px;
            height: 30px;
            text-align: center;
            margin-left: 5px;
            cursor: pointer;
        }

        ul {
            list-style: none;
        }

        #total > li {
            white-space: nowrap;
            text-overflow: ellipsis;
            -o-text-overflow: ellipsis;
            overflow: hidden;
            width: 150px;
        }

        .navbar {
            height: auto;
        }

        img[src="0"], img:not([src]) {
            opacity: 0;
        }
        .actGotop{position:fixed; _position:absolute; bottom:100px; right:25px; width:150px; height:195px; display:none;}
        .actGotop a,.actGotop a:link{width:150px; height:195px; display:inline-block; background:url(img/blog7year_gotop.png) no-repeat; _background:url(img/blog7year_gotop.gif) no-repeat; outline:none;}
        .actGotop a:hover{width:150px; height:195px; background:url(img/blog7year_gotopd.gif) no-repeat; outline:none;}
    </style>

</head>
<body>
<header class="container-fluid head">
    <div class="row">
        <nav class="navbar navbar-inverse navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                            data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" style="font-size: 30px;font-weight: bolder;color: white">学声</a>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav" id="nav_container">
                        <!--<li><a href="#" style="font-size: 20px">首页<span class="sr-only">(current)</span></a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">学术圈</a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">吐槽会</a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">男女那些事</a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">废品重用</a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">学术资源分享</a></li>-->
                        <!--<li><a href="#" style="font-size: 18px">下课后</a></li>-->
                    </ul>
                    <div class="navbar-middle">
                        <a href="Login.html" class="btn btn-default btn-lg active" role="button" id="login"
                           style="margin-right: 10px">登录</a>
                        <a href="#" class="btn btn-default btn-lg active" role="button" id="register">注册</a>
                    </div>
                    <div>
                        <ul class="nav navbar-nav navbar-right">
                            <li><a href="#">关于我们</a></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                   aria-haspopup="true" aria-expanded="false">帮助<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">使用说明</a></li>
                                    <li><a href="#">权益说明</a></li>
                                    <li><a href="#">联系方式</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="#">感谢支持</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
        </nav>
    </div>
</header>
<!--主体-->
<br><br><br>

<div class="container">
    <div class="row">
        <div style="float: left;width: 10px;height: 40px;background-color: #66afe9"></div>
        <div style="margin-top: 5px">
            <span style="color: #ff5f17;font-size: 20px;font-weight: bolder">内容>>></span>
        </div>
    </div>
    <div class="row">
        <div class="col-md-9">
            <div class="row title">
                <div style="margin: 10px;height: 80px">
                    <div><img src="img/userimg.jpg" class="img-circle" style="float: left;width: 30px" height="30px">
                    </div>
                    <div id="user" style="font-size: 15px;color: #999999;">标题：</div>
                    <br>
                    <div id="title" height="40px"><input type="text" style="width: 600px" placeholder="请输入标题"
                                                         maxlength="25" id="ti"></div>
                </div>
            </div>
            <div class="row context">
                <div id="date" style="font-size: 15px;color: #999999"><textarea style="width: 875px;height: 610px;color: black"
                                                                                placeholder="请输入内容" id="main"></textarea></div>
            </div>
            <div style="margin-top: 20px">
                <button type="button" class="btn btn-primary btn-lg" style="float: left" id="bsubmit">提交</button>
                &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
                <button type="button" class="btn btn-danger btn-primary btn-lg" id="delete">撤销</button>
            </div>
        </div>
        <div class="col-md-3">
            <p style="font-size: 30px">必选</p>
            <div style="line-height: 40px;font-size: 20px">
                <input type="radio" name="cname" value="1" checked>学术圈<br>
                <input type="radio" name="cname" value="2" >吐槽会<br>
                <input type="radio" name="cname" value="3" >男女那些事<br>
                <input type="radio" name="cname" value="4" >废品重用<br>
                <input type="radio" name="cname" value="5" >学术资源分享<br>
                <input type="radio" name="cname" value="6" >下课后
            </div>
            <br>
            <br>
            <br>
            <div style="background: white;">
            <form id="myForm" enctype="multipart/form-data">
             文件:<input id="uploads" type="file" name="uploads"/><br>
            </form>
            </div>
        </div>
    </div>
</div>
<div class="actGotop"><a href="javascript:;" title="Top"></a></div>
<!--<div><img src="img/r3.jpg" style="bottom: 0px;right: 0px;position: fixed" class="img-circle" width="100px" height="100px" id="img"></div>-->

<footer class="container-fluid xueba1" style="margin-top: 20px">
    <div class="row" style="background-color:#e6e6e6;color:#777777;text-align: center">
        <img src="img/logo.png" style="float: left" width="150px" height="60px">
        <div  class="col-md-8">
            <p style="float: left">学声网为如弟，GC，大豚哥开发，内容尚未完善</p><br><br>
            <p style="float: left">版权由开发者所有，感谢支持</p>
        </div>
        <div style="margin-left:700px;margin-top: -55px" class="col-md-4">
            <a rel="nofollow" href="http://www.beian.miit.gov.cn" ><span>备案号：</span>苏ICP备19067655号</a><br>
            <a href="#" style="color: #777777">联系方式</a>
        </div>
    </div>
</footer>
<script>
    $(function () {
        $.post("user/find", {}, function (data) {
            $(".navbar-middle").html("<p>欢迎光临</p>" + data.username);
            $(".navbar-middle").append("<a href='/personalpage.html'>   &nbsp&nbsp   个人资料  &nbsp&nbsp </a>");
            $(".navbar-middle").append("<a href='user/quit'> 退出  </a>")
        })
    })
    $(function () {
        $.post("category/findAll", {}, function (data) {
            var lis = '<li><a href="index.html" style="font-size: 20px">首页<span class="sr-only">(current)</span></a></li>';
            for (var i = 0; i < data.length; i++) {
                var li = '<li><a href="searchpage.html?cid='+data[i].cid+'" style="font-size: 18px">' + data[i].cname + '</a></li>';
                lis += li;
            }
            $("#nav_container").html(lis)
        });
    });
</script>
<script>
    $("#bsubmit").click(function () {
        var cid = $('input:radio:checked').val();
        var title = $("#ti").val();
        var context = $("#main").val();
        var  formData=new FormData();
        var formData = new FormData($('#myForm')[0]);
        formData.append('uploads',uploads);
        formData.append('cid',cid);
        formData.append('title',title);
        formData.append('context',context);
        if (title) {
        // $.post("topic/insertcontext", {cid: cid, title: title, context: context}, function (data) {
        // }, "json");
            $.ajax({
                type: 'post',
                url: "topic/insertcontext",
                data: formData,
                dataType: 'JSON',
                cache: false,                      // 不缓存
                processData: false,                // jQuery不要去处理发送的数据
                contentType: false,
            }).success(function (data) {
            }).error(function () {
            });
    }
        location.href="personalpage.html"
    })
    $("#img").click(function () {
        $("html,body").stop().animate({
            scrollTop: 0
        },400)
    });
    $("#delete").click(function () {
        if (confirm("确定清空")) {
            $("#main").val("")
        }
    })
    // $("#simg").click(function () {
    //     var formData1 = new FormData($('#myForm')[0]);
    //     $.ajax({
    //         type: 'post',
    //         url: "topic/insertimg",
    //         data: formData1,
    //         cache: false,
    //         processData: false,
    //         contentType: false,
    //     }).success(function (data) {
    //     }).error(function () {
    //         alert("上传失败");
    //     });
    // })
</script>
<script type="text/javascript">
    $(function(){
        $(window).scroll(function() {
            if($(window).scrollTop() >= 100){
                $('.actGotop').fadeIn(300);
            }else{
                $('.actGotop').fadeOut(300);
            }
        });
        $('.actGotop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);});
    });
</script>
</body>
</html>